﻿using Portfolio.DataModels;
using Portfolio.Web.IDataAdapters.Adapters;
using Portfolio.Web.IDataAdapters.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace Portfolio.Web.Controllers
{
    public class EmailController : ApiController
    {
        IProjectAdapter _adapter = new ProjectAdapter();
        //Post api/item
        public IHttpActionResult Post(Email mail)
        {
            //send this to them
            _adapter.SendEmail(mail.Address, "Thank You for your email!", "Thanks! I Got your email! I will reply back as soon as possible!");
            //send this to me
            _adapter.SendEmail("gojoshyi@gmail.com", mail.Subject, "message from " + mail.Name + "//" + mail.Message);
            return Ok();
        }
    }
}
